

''' Step1: Read data '''
words_file = open('../words.txt','r')

total_list = []

for line in words_file:

    line = line.rstrip() # delete  the \n
    line_list = line.split(' ') # 语句拆分为单词
    total_list.extend(line_list)


''' Step2: 将 list 转化为 dict '''
total_dict = dict.fromkeys(total_list)


''' Step3: 判断某个单词是否在 字典的key中 '''

words_file.close()